import request from '@/utils/request'

export function getPositions() {
  return request({
    url: '/position',
    method: 'get'
  })
}

export function addPosition(data) {
  return request({
    url: '/position',
    method: 'post',
    headers: {'Content-Type':'application/x-www-form-urlencoded'},
    params: {
      name: data
    }
  })
}

export function modifyPosition(id, data) {
  return request({
    url: `/position/${id}`,
    method: 'put',
    headers: {'Content-Type':'application/x-www-form-urlencoded'},
    params: {
      name: data
    }
  })
}

export function deletePosition(id, status) {
  return request({
    url: `/position/status/${id}?status=${status}`,
    method: 'put'
  })
}
